package com.api.viewModel;

import android.app.Application;


import com.activity.App;
import com.api.response.ResponseException;
import com.example.apple.ddhr_new.utils.ActivityUtil;
import com.example.lzbase.BaseViewModel;

import androidx.annotation.NonNull;

public abstract class BaseResponseViewModel extends BaseViewModel {

    public  static  final  int ERROR_TOKEN_OUT_TIME =  -1011;
    public BaseResponseViewModel(@NonNull Application application) {
        super(application);
    }

    @Override
    public void onError(Throwable throwable) {
        super.onError(throwable);
        if (throwable instanceof ResponseException)
        {
            ResponseException exception = (ResponseException) throwable;
            if(exception.status==ERROR_TOKEN_OUT_TIME){
//                App.getInstance().setAccount(null);
//                ActivityUtil.startLoginActivity(this.getApplication());
            }

        }
    }

}
